package com.eduadmin.service;

import com.eduadmin.entity.StatisticsParamiter;
import com.eduadmin.mapper.StatisticsParamiterMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class StatisticsParamiterServiceImpl implements IStatisticsParamiterService {
    private final StatisticsParamiterMapper statisticsParamiterMapper;

    @Autowired
    public StatisticsParamiterServiceImpl(StatisticsParamiterMapper statisticsParamiterMapper) {
        this.statisticsParamiterMapper = statisticsParamiterMapper;
    }

    @Override
    public List<StatisticsParamiter> getAllStatisticsParamiter() {
        return statisticsParamiterMapper.getAllStatisticsParamiter();
    }

    @Override
    public int addStatisticsParamiter(List<StatisticsParamiter> statisticsParamiterList) {
        return statisticsParamiterMapper.insertStatisticsParamiter(statisticsParamiterList);
    }

    @Override
    public int getStatisticsParamiterByExamName(String examName) {
        return statisticsParamiterMapper.selectStatisticsParamiterByExamName(examName);
    }

    @Override
    public List<StatisticsParamiter> getAllStatisticsParamiters(Map<String, Object> paraMap) {
        return statisticsParamiterMapper.selectAllStatisticsParamiters(paraMap);
    }

    @Override
    public Long getAllTotal(Map<String, Object> paraMap) {
        return statisticsParamiterMapper.selectAllTotal(paraMap);
    }

    @Override
    public int addOneStatisticsParamiter(StatisticsParamiter statisticsParamiter) {
        return statisticsParamiterMapper.insertOneStatisticsParamiter(statisticsParamiter);
    }

    @Override
    public int updateStatisticsParamiter(StatisticsParamiter statisticsParamiter) {
        return statisticsParamiterMapper.updateStatisticsParamiter(statisticsParamiter);
    }

    @Override
    public int deleteStatisticsParamiter(String paramiterIdString) {
        return statisticsParamiterMapper.deleteStatisticsParamiter(paramiterIdString);
    }


    @Override
    public StatisticsParamiter getStatisticsParamiterByParams(String semesterName,String gradeName,String examName,String categoryName){
        return statisticsParamiterMapper.getStatisticsParamiterByParams(semesterName,gradeName,examName,categoryName);
    }
}
